package cn.hdu.liang.generics;

interface Ex {
    void f();

    void g();
}

class MyEx implements Ex {
    @Override
    public void f() {
        System.out.println("MyEx.f()");
    }

    @Override
    public void g() {
        System.out.println("MyEx.g()");
    }

    public void h() {
        System.out.println("MyEx.h()");
    }
}

class Other {
    public <T extends Ex> void fun(T t) {
        t.f();
        t.g();
        ((MyEx) t).h();
    }
}


public class Exam20 {
    public static void main(String[] args) {
        Other other = new Other();
        other.fun(new MyEx());
    }
}
